/** \file
* Platform-independent implementations for the debug console class.
* This file is part of Chorus, available at
* http://code.google.com/p/chorus-twitter/ . This file and all associated files
* and derivative works are bound by the terms of the LGPL 3.0 license,
* available at http://www.gnu.org/licenses/lgpl-3.0-standalone.html .
* \par Subversion URL:
* \$URL: http://chorus-twitter.googlecode.com/svn/branches/cpp/src/tests/Test.cpp $
* \version \$Rev: 152 $
* \date    \$Date: 2010-04-06 07:35:13 +0000 (Tue, 06 Apr 2010) $
*/

#include "config.h"

#include "system/DebugConsole.hpp"
#include "tests/Test.hpp"

using namespace std;

TestSet::~TestSet()
{
	// Delete the tests that have been allocated by this instance of TestSet.
	for (TestListIter i = tests.begin();
		i != tests.end();
		i++)
		delete *i;
}

bool TestSet::doTests()
{
	// Loop through the tests. Do all of them regardless of failure.
	bool success = true;
	for (TestListIter i = tests.begin();
		i != tests.end();
		i++)
	{
		if (!(*i)->test())
		{
			success = false;
			PDEBUG("Test failed");
		}
	}
	if (success)
		PDEBUG("All tests passed");
	return success;
}
